@extends('admin.layout.app')

@section('title')
    修改密码
@endsection

@section('style')
	<link rel="stylesheet" type="text/css" href="/admin/css/update_pass.css">
@endsection

@section('content') 
	@component('admin.components.nav') 
	@endcomponent
		<!--main-->
		<main v-cloak>
			<div id="update-container" class="container">
				<div class="breadcrumb">
					<div class="row">
						<div class="col-xs-12 col-sm-6 col-md-6 col-lg-6">
							<h3>修改密码</h3>
						</div>
					</div>
				</div>
				<div class="update-wrap">
					<div class="row">
						<div class="col-xs-12 col-sm-10 col-sm-offset-1">
							<form action="" id="update-form">
								<div class="form-group has-feedback">
								    <label class="control-label" for="">旧密码</label>
								    <input v-if="!show_old" type="password" class="form-control" id="" placeholder="请输入旧密码"  v-model="formData.old_password">
								    <input v-else type="text" class="form-control" id="" placeholder="请输入旧密码" v-model="formData.old_password">
								    <span class="form-control-feedback" @click="toggleInput(0)"><img v-if="!show_old" src="/imgs/icons_eye_open.png"/><img v-else src="/imgs/icons_eye_close.png"></span>
								</div>
								<div class="form-group has-feedback">
								    <label class="control-label" for="">新密码</label>
								    <input v-if="!show_new" type="password" class="form-control" id="" placeholder="请输入新密码(英文字母及数字，6-20位)" v-model="formData.password">
								    <input v-else type="text" class="form-control" id="" placeholder="请输入新密码(英文字母及数字，6-20位)" v-model="formData.password">
								    <span class="form-control-feedback" @click="toggleInput(1)"><img v-if="!show_new" src="/imgs/icons_eye_open.png"/><img v-else src="/imgs/icons_eye_close.png"></span>
								</div>
								<div class="form-group has-feedback">
								    <label class="control-label" for="">确认新密码</label>
								    <input v-if="!show_confirm" type="password" class="form-control" id="" placeholder="请重新输入新密码(英文字母及数字，6-20位)" v-model="formData.password_confirmation">
								    <input v-else type="text" class="form-control" id="" placeholder="请重新输入新密码(英文字母及数字，6-20位)" v-model="formData.password_confirmation">
								    <span class="form-control-feedback" @click="toggleInput(2)"><img v-if="!show_confirm" src="/imgs/icons_eye_open.png"/><img v-else src="/imgs/icons_eye_close.png"></span>
									<p class="help-block text-danger" :class="{invisible:!hasError}">@{{tips}}</p>
								</div>
								<div class="form-group text-center">
									<button type="button" class="btn btn-primary btn-update"  data-loading-text="正在提交"  @click="updatePass">确认修改</button>
								</div>
							</form>
						</div>
					</div>
				</div>
			</div>
		</main>
@endsection

@section('script')
	<script type="text/javascript">
        var activeIndex = 6
    </script>
    <script src="/admin/js/nav.js" type="text/javascript"></script>
	<script src="/admin/js/update_pass.js" type="text/javascript"></script>
@endsection